# {"love":爱,"you":你}  n = 10

def hash(key):
    return key % n

def insert(key,value):
    index = hash(ord(key[1]))
    while hashTable[index][0]:
        index+=1
        if index >= 10:
            index=0
    hashTable[index] = [key,value]
    
    
def find(key):
    index = hash(ord(key[1]))
    if key == hashTable[index][0]:
        return hashTable[index][1]
    else:
        search = False
        while hashTable[index][0]!=None:
            if key == hashTable[index][0] :
                search =True
                break
            else:
                index+=1
        if search:
            return hashTable[index][1]
        else:
            return -1

if __name__ == '__main__':
    n = 10
    hashTable = [[None,None] for i in range(10)]
    insert("love","ai")
    insert("length","changdu")
    insert("you","ni")
    insert("computer","jisuanji")
    print(find("length"))